﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;

namespace FusionDotNet.Tests
{
    [TestClass]
    public class TableTests
    {
        [TestCategory("CREATE TABLE"), TestMethod]
        public void CreateTableNoSchema()
        {
            try
            {
                CreateTableCommand command = new CreateTableCommand(null);
                ScalarResult<int> result = command.Execute();
            }
            catch (InvalidOperationException)
            {
            }
        }

        [TestCategory("CREATE TABLE"), TestMethod]
        public void CreateTableNoTableName()
        {
            DataTable newTable = new DataTable();
            try
            {
                CreateTableCommand command = new CreateTableCommand(newTable);
                ScalarResult<int> result = command.Execute();
            }
            catch (InvalidOperationException)
            {
            }
        }

        [TestCategory("CREATE TABLE"), TestMethod]
        public void CreateTableNoColumns()
        {
            DataTable newTable = new DataTable("TestTable" + DateTime.Now.ToString("ddMMyyyyhhmmss"));
            try
            {
                CreateTableCommand command = new CreateTableCommand(newTable);
                ScalarResult<int> result = command.Execute();
            }
            catch (InvalidOperationException)
            {
            }
        }
    }
}
